package org.dromara.batch;

import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;

/**
 * 理财账户赎回任务
 **/
public class FinanceRedeemTasklet implements Tasklet {
    private FinanceAccountService financeAccountService;

    public FinanceRedeemTasklet(FinanceAccountService financeAccountService) {
        this.financeAccountService = financeAccountService;
    }

    @Override
    public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
        financeAccountService.redeem();
        return RepeatStatus.FINISHED;
    }
}